<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		工厂设计模式：相同的代码提取封装，批量创建，提高效率
		<script>
			// var obj={
			// 	name:"lili",
			// 	age:21,
			// 	job:"CEO"
			// }
			
			// var obj2={
			// 	name:"lisa",
			// 	age:22,
			// 	job:"CEO"
			// }
			
			function createobj(n,a,j){
				return {
					name:n,
					age:a,
					job:j
				}
			}
			var obj1=createobj("lili",20,"ceo");
			var obj2=createobj("lise",22,"ceo");
			console.log(obj1);
			console.log(obj2);
		</script>
	</body>
</html>
